Q: How do you execute ~/.login, ~/.cshrc, ~/.profile, or ~/.logout without invoking Terminal, Shell, or a similar sort of shell-based terminal emulator? Is there a hook in Workspace Manager that allows you do something when you log in or log out?\
\
A: All the shell run control files (the ones mentioned above) are shell-specific. .cshrc, .login, and .logout pertain to the C-Shell; .profile pertains to the Bourne Shell. Only those programs examine and execute these files. (By implication, then, if your login shell is neither csh nor sh, these files will not be executed even when you launch Terminal or Shell.)\
\
There is a "LoginHook" and a "LogoutHook" in
\b loginwindow
\b0 . The LoginHook is run just before loginwindow launches the specified workspace (by default, the NeXT Workspace Manager; but this can be overridden in the user's defaults database), and after account verification. Note that the LoginHook is NOT run under the Workspace Manager, but rather is run BEFORE the Workspace Manager. LogoutHook is run after the Workspace Manager terminates.\
\
To set up these hooks, type:\
\f3 \
\fs24 myhost%
\b su
\b0 \
myhost#
\b dwrite loginwindow LoginHook someProgram
\b0 \
myhost#
\b dwrite loginwindow LogoutHook someOtherProgram
\b0 \
myhost#
\b exit
\b0 \
\fs28 \
\f0 where the final argument to
\b dwrite
\b0 is the name of whatever program you want to run.
\b
\b0 This creates the default on a machine-by-machine basis, since the information is stored in the directory /.NeXT. (Of course, if you have netboot clients, it need only be done on the servers of all the clients, since the root directory is shared.
\b )\
\b0 \
Note that neither hook is run if an automatic "me" login is performed. The real philosophy behind the hooks is to provide additional accounting or authentication, rather than setting up the Workspace Manager's environment. If something is required within the Workspace Manager's environment, the only real option is to have a program of your specification autolaunched from your dock. (Yes, this will use up one of your dock slots, and it's only an option when you have an available dock slot.)\